package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.domain.TravelTemplate;
import cn.wolfcode.luowowo.search.repository.TravelTemplateRepository;
import cn.wolfcode.luowowo.search.service.ITravelSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

import java.util.List;

@Service
public class ITravelSearchServiceImpl implements ITravelSearchService {
    @Autowired
    private TravelTemplateRepository repository;
    @Autowired
    private ElasticsearchTemplate template;

    @Override
    public void saveOrUpdate(TravelTemplate travelTemplate) {
        repository.save( travelTemplate );
    }

    @Override
    public List<TravelTemplate> queryByDestName(String destName) {

     return    repository.findByDestName(destName);
    }
}
